package com.project.stream_producer.demo5.conf;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

import java.util.concurrent.ExecutionException;


@Component
public class StringProducer {
    @Autowired
    @Qualifier("stringKafkaTemplate")
    private KafkaTemplate<String, String> kafkaTemplate;


    public void send(String message) throws ExecutionException, InterruptedException {
        kafkaTemplate.send("mykafkainput", message).get();
    }



}
